﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CheatMenu.Utils
{
    public class Group<T>
    {
        public string Name { get; set; }
        public List<T> Children { get; private set; } = new List<T>();

        public Group(string name)
        {
            Name = name;
        }

        public void Clear()
        {
            Children.Clear();
        }

        //public void AddChild(string name, T child) //, bool toggleState = false
        //{
        //    if (Children.Where((c) => c.Name.Equals(name, StringComparison.OrdinalIgnoreCase)).Count() == 0)
        //        Commands.Add(new Command(name, action, toggleState));
        //    else
        //        LogManager.LogWarning($"Trying to add existing command with name: {name}");
        //}

        //public void RemoveChild(string name)
        //{
        //    var existingCommand = Commands.Where((c) => c.Name.Equals(name, StringComparison.OrdinalIgnoreCase));
        //    if (existingCommand.Count() == 1)
        //        Commands.Remove(existingCommand.First());
        //    else
        //        LogManager.LogWarning($"Trying to remove non-existing command with name: {name}");
        //}
    }
}
